#ifndef __FIFO_H
#define __FIFO_H

#define FIFO_LENGTH 1024
#define incFifoPtr(i) (((i)+1)%FIFO_LENGTH)

typedef struct FifoElement_S
{
  void * element;
} FifoElement_T;
typedef FifoElement_T * FifoElement;

typedef struct Fifo_S
{
  int head;
  int tail;
  FifoElement_T queue[FIFO_LENGTH];
} Fifo_T;
typedef Fifo_T * Fifo;

Fifo newFifo(void);
int isFifoEmpty(Fifo f);
void enqueue(Fifo f, FifoElement e);
void dequeue(Fifo f, FifoElement e);
int nbdequeue(Fifo f, FifoElement e);

#endif
